package com.dsbj.mp.icardservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsbj.mp.icardservice.entity.MonthReport;

import java.util.List;
import java.util.Map;

public interface MonthReportMapper extends BaseMapper<MonthReport>, OcsMapper {
	
	int updateALL(Map<String, Object> map);
	
	//通过工号 公司号  日期拿到 具体一条数据
	MonthReport findByCompanynoAndTimeAndEmployeeno(String companyno, String employeeno, String overtimedate);
	
	//通过工号 公司号  日期 status 拿到 具体一条数据
	MonthReport findByCompanyAndEmployeeAndTimeAndStatus(String companyno, String employeeno, String overtimedate, int status);
	
	List<MonthReport> findByByYearmonthOrEmployeenoOrDepart(MonthReport monthReport);
	
	void unlack(Map<String, Object> map);
	
	/**
	 * 查询某个员工当年的病假天数
	 *
	 * @param companyno
	 * @param employeeno
	 * @param yearmonth
	 * @return
	 */
	int findSumSickleavehourByEmployeeno(String companyno, String employeeno, String yearmonth);
	
	/**
	 * 导出PDF
	 *
	 * @param workTypes
	 * @param file
	 */
	void lack(Map<String, Object> map);
	
	/**
	 * 公司  、工号 、 日期  查询
	 *
	 * @param map
	 * @return
	 */
	MonthReport findByCompanynoAndEmpanynoAndYearmonth(Map<String, Object> map);
	
	//查找是否存在这个月份
	List<MonthReport> findByYearmonthonly(String yearmonth, String companyno);
	
	/**
	 * 通过公司编号、月份查询员工工号
	 *
	 * @param companyno
	 * @param yearmonth
	 * @return
	 */
	List<String> findEmployeenoByYearmonthonly(String companyno, String yearmonth);
	
	void updateALLByCompanynoAndYearmonth(String companyno, String yearmonth, Integer status, String updateUser);
	
	void deleteByEmployeenoAndCompanynoAndYearmonth(String employeeno, String companyno, String yearmonth);
	
	void deleteByCompanynoAndYearmonth(String companyno, String yearmonth);
	
	int MonthReportCount(Map<String, Object> map);
	
	List<?> queryPageForMonthReport(Map<String, Object> map);
	
	List<MonthReport> finddeffint(MonthReport monthReport);
	
	/**
	 * 排班异常查询  导出List
	 *
	 * @param map
	 * @return
	 */
	List<MonthReport> findByMonthReport(Map<String, Object> map);
	
	//自定义分页查询
	int countYearReport(Map<String, Object> map);
	
	List<MonthReport> queryPageYearReport(Map<String, Object> map);
	
	List<MonthReport> findByYearReport(MonthReport monthReport);
	
}